<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="model.*" %>  
<%@ page import="dao.*" %>  
<%@ page import="util.*" %>  
<%@ page import="java.sql.*" %>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="">

    <title>员工页面</title>
    <!-- 引入bootstrap -->
    <link href="../css/bootstrap.min.css" rel="stylesheet">

 
</head>
<body>
<nav class="navbar navbar-default">
  <a class="navbar-brand" href="#">库存系统--员工</a>
  <div class="container">
  	<ul class="nav navbar-nav">
   		<li><a href="./jinhuo.jsp">进货</a></li>
   		<li><a href="./tuihuo.jsp">退货</a></li>
   		<li><a href="./chuhuo.jsp">出货</a></li>
   		<li><a href="./xiugai.jsp">修改</a></li>
   		<li><a href="../ExitController">退出</a></li>
   	</ul>
  </div>
</nav>
<div style="width:1000px;margin: 0 auto">
<table class="table">
	<thead>
		<td>单据Id</td>
		<td>单据代码</td>
		<td>单据类型</td>
		<td>数量</td>
		<td>创建者</td>
		<td>时间</td>
		<td>产品ID</td>
		<td>原因</td>
		<td>状态</td>
		<td>操作</td>
	</thead>
	<%
	DBUtil util = new DBUtil("select * from stock");
	ResultSet rs = null;
	try {
		 rs  = util.pst.executeQuery();
		while(rs.next()){
	%>
	<tr>
		<form action="../SaveController">
		<td><%=rs.getString("STOCK_ID") %></td>
		<td><input type="text" name="stockCode" value="<%=rs.getString("STOCK_CODE") %>"></td>
		<td>进货单</td>
		<input type="hidden" value="stock" name="type">
		<input type="hidden" value="<%=rs.getString("STOCK_ID") %>" name="id">
		<td><%=rs.getString("QUANTITY") %></td>
		<td><input type="text" name="creator" value="<%=rs.getString("CREATOR")%>"></td>
		<td><%=rs.getDate("TS") %></td>
		<td><%=rs.getString("PRODUC_ID")%></td>
		<td>无</td>
		<td><%=rs.getString("STATUS")%></td>
		<td><input type="submit" value="保存修改"></td>
		</form>
	</tr>
	<%
		}
		util.close();
	} catch (SQLException e) {
		util.close();
	}
	%>
	<%
    util = new DBUtil("select * from reject");
	rs = null;
	try {
		 rs  = util.pst.executeQuery();
		while(rs.next()){
	%>
	<tr>
		<form action="../SaveController">
		<td><%=rs.getString("REJECT_ID") %></td>
		<td><input type="text" name="stockCode" value="<%=rs.getString("REJECT _CODE") %>"></td>
		<td>出货单</td>
		<input type="hidden" value="reject" name="type">
		<input type="hidden" value="<%=rs.getString("REJECT_ID") %>" name="id">
		<td><%=rs.getString("QUANTITY") %></td>
		<td><input type="text" name="creator" value="<%=rs.getString("CREATOR")%>"></td>
		<td><%=rs.getDate("TS") %></td>
		<td><%=rs.getString("PRODUC_ID")%></td>
		<td>无</td>
		<td><%=rs.getString("STATUS")%></td>
		<td><input type="submit" value="保存修改"></td>
		</form>
	</tr>
	<%
		}
		util.close();
	} catch (SQLException e) {
		util.close();
	}
	%>
	<%
    util = new DBUtil("select * from `return`");
	rs = null;
	try {
		 rs  = util.pst.executeQuery();
		while(rs.next()){
	%>
	<tr>
		<form action="../SaveController">
		<td><%=rs.getString("REJECT_ID") %></td>
		<td><input type="text" name="stockCode" value="<%=rs.getString("REJECT _CODE") %>"></td>
		<td>退货单</td>
		<input type="hidden" value="return" name="type">
		<input type="hidden" value="<%=rs.getString("REJECT_ID") %>" name="id">
		<td><%=rs.getString("QUANTITY") %></td>
		<td><input type="text" name="creator" value="<%=rs.getString("CREATOR")%>"></td>
		<td><%=rs.getDate("TS") %></td>
		<td><%=rs.getString("PRODUC_ID")%></td>
		<td><%=rs.getString("REASON")%></td>
		<td>无</td>
		<td><input type="submit" value="保存修改"></td>
		</form>
	</tr>
	<%
		}
		util.close();
	} catch (SQLException e) {
		util.close();
	}
	%>
</table>
</div>
</body>
</html>